import { defineStore } from "pinia";

interface loadState{
    loadCount:number,
    timeToload:boolean,
    loadingMessage:string
}

export const loadingStatsStore = defineStore('LoadingStore',{
    state:():loadState=>({
        loadCount:0,
        timeToload:false,
        loadingMessage:'加载中...',
    }),

    getters:{
        
    },

    actions:{
        completeLoad(){
            this.timeToload=false;
        },

        startLoad(){
            this.timeToload=true;
        },

        setLoadingText(myText:string){
            this.loadingMessage=myText;
        },

        loadCountAdd(){
            this.loadCount++;
        }
    }
})